<h1>FontInfo</h1>

<p>FontInfo defines the name and face of a font and maps the codes for a given character 
set to the glyphs that are drawn to represent each character.</p>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">10</td>
<td>Identifies the FontInfo instruction when it is encoded. It is encoded 
with the length field as a 16-bit integer (Little-endian byte order).</td>
</tr>

<tr>
<td nowrap valign="top">length</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">6</td>
<td>The length in bytes of the body of the instruction when it is encoded. Encoded with the type 
field as a 16-bit integer. If the length is greater than 62 bytes then this field
is set to 0x3F and the next field, extendedLength contains the length of the
body of the encoded instruction.</td>
</tr>

<tr>
<td nowrap valign="top">extendedLength</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">32</td>
<td>Optional. Contains the length in bytes of the encoded instruction if it is
greater than 62 bytes. If the length is 62 bytes or less then this field is 
omitted.</td>
</tr>

<tr>
<td nowrap valign="top">nameLength</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">8</td>
<td>The number of bytes in the string containing the name of the font.</td>
</tr>

<tr>
<td nowrap valign="top">name</td>
<td nowrap valign="top">String</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>The name of the font.</td>
</tr>

<tr>
<td nowrap valign="top">reserved</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">3</td>
<td>Reserved</td>
</tr>

<tr>
<td nowrap valign="top">isSmall</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Are the glyphs drawn to align with pixel boundaries.</td>
</tr>

<tr>
<td nowrap valign="top">isShiftJIS</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Are the character codes encoded using the ShiftJIS character set.</td>
</tr>

<tr>
<td nowrap valign="top">isANSI</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Are the character codes encoded using the ANSI (ASCII) character set.</td>
</tr>

<tr>
<td nowrap valign="top">isItalic</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Whether the font is italicised.</td>
</tr>

<tr>
<td nowrap valign="top">isBold</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Whether the font is bold.</td>
</tr>

<tr>
<td nowrap valign="top">isWideCodes</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td>Are the character codes encoded as 16-bit values (true) or 8-bit (false).</td>
</tr>

<tr>
<td nowrap valign="top">codes</td>
<td nowrap valign="top">unsigned int[glyphCount]</td>
<td nowrap valign="top" align="right">8 or 16</td>
<td>An array mapping a glyph index to a particular character code in the font.
The size of the entry is either 8 or 16 bits depending on whether the
hasWideCodes flag is false or true.</td>
</tr>

</table>

<p>The ANSI character set is used for Latin languages, SJIS is used for Japanese 
language characters and Unicode is used for any character set. The encoding 
attributes uses the constants ANSI, SJIS or Unicode 
for each character set type.</p>

<p>The index of each entry in the codes array matches the index in the corresponding 
glyph in the corresponding DefineFont structure, allowing a given character 
code to be mapped to a given glyph.</p>

<p>The class allows the font associated with a Flash file to be mapped to a font 
installed on the device where the Flash Player displaying the file is hosted. 
The use of a font from a device is not automatic but is determined by the HTML 
tag option <i>deviceFont</i> which is passed to the Flash Player when it is first 
started. If a device does not support a given font then the glyphs in the font
definition (DefineFont) are used to render the characters.</p>

<p>An important distinction between the host device to specify the font and using 
the glyphs in a font definition is that the device is not anti-aliased and 
the rendering is dependent on the host device. The glyphs in a font definition
 are anti-aliased and are guaranteed to look identical on every device the 
text is displayed.</p>

<h2>History</h2>

<p>FontInfo represents the DefineFontInfo data structure from the 
Flash specification. It was introduced in Flash 1. Support for small fonts was 
added in Flash 7.</p>
